var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = t("AssemblyItem"),
s = t("CarConstant"),
l = t("HallWheelControl"),
c = cc._decorator,
d = c.ccclass,
h = c.property,
p = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.node_assemblyItem = null,
        e.node_hint = null,
        e.ani_hint = null,
        e.assemblyItem = null,
        e.otherEnterId = 0,
        e.otherExitId = 0,
        e
    }
    return n(e, t),
    e.prototype.onLoad = function() {
        this.assemblyItem = this.node_assemblyItem.getComponent(r.AssemblyItem)
    },
    e.prototype.onCollisionEnter = function(t, e) {
        if ("move" == this.assemblyItem.getTouchState()) {
            switch (this.otherExitId = null, t.tag) {
                case s.colliderTag.Hall.body:
                    break;
                case s.colliderTag.Hall.wheel:
                    this.otherEnterId = t.node.getComponent(l.default).getWheelUid();
                break;
                case s.colliderTag.Hall.weapon:
                case s.colliderTag.assembly.body:
                    break;
                case s.colliderTag.assembly.wheel:
                    this.otherEnterId = this.assemblyItem.getTouchMoveUid();
                break;
                case s.colliderTag.assembly.weapon:
            }
            this.playHintAnimation(!0),
            console.log("", this.otherEnterId),
            this.assemblyItem.onEquipCarItem(this.otherEnterId, this.otherExitId, t.tag, e.tag)
        }
    },
    e.prototype.onCollisionExit = function(t, e) {
        if ("move" == this.assemblyItem.getTouchState()) {
            switch (this.otherEnterId = null, this.otherEnterId = null, t.tag) {
                case s.colliderTag.Hall.body:
                    break;
                case s.colliderTag.Hall.wheel:
                    this.otherExitId = t.node.getComponent(l.default).getWheelUid();
                break;
                case s.colliderTag.Hall.weapon:
                case s.colliderTag.assembly.body:
                    break;
                case s.colliderTag.assembly.wheel:
                    this.otherExitId = this.assemblyItem.getTouchMoveUid();
                break;
                case s.colliderTag.assembly.weapon:
            }
            this.stopHintAnimation(),
            console.log("", this.otherExitId),
            this.assemblyItem.onEquipCarItem(this.otherEnterId, this.otherExitId, t.tag, e.tag)
        }
    },
    e.prototype.getCarId = function() {
        this.assemblyItem.getItemUid()
    },
    e.prototype.setOpacity = function(t, e) {
        this.node.opacity = t,
        0 == t ? this.stopHintAnimation() : e && this.playHintAnimation(!1)
    },
    e.prototype.playHintAnimation = function(t) {
        var e = this;
        this.node.scale = 1.2,
        this.node_hint.active = !0,
        t ? this.ani_hint.play() : (this.ani_hint.play(), this.scheduleOnce(function() {
            e.stopHintAnimation()
        },
        .5))
    },
    e.prototype.stopHintAnimation = function() {
        this.node.scale = 1,
        this.ani_hint.stop(),
        this.node_hint.active = !1
    },
    a([h(cc.Node)], e.prototype, "node_assemblyItem", void 0),
    a([h(cc.Node)], e.prototype, "node_hint", void 0),
    a([h(cc.Animation)], e.prototype, "ani_hint", void 0),
    a([d], e)
} (cc.Component);
o.default = p